from primes import primes

print "getting primes.."
p = primes(10000)

print "looking for sequences.."
for i in range(1000, 10000-3335) :
    if i%100 == 0 : print "."
    for j in range(2, 3335, 2) :
        if i in p and i+j in p and i+j+j in p :
            	if sorted(str(i)) == sorted(str(i+j)) == sorted(str(i+j+j)) :
			print i, i+j, i+j+j

